package com.hsp.Demo_11_innerclass;

import javax.lang.model.element.VariableElement;

public class Outter07 {

    //外部类的私有属性
    private int count = 1;
    //外部类的公共属性
    public int size = 2;


    //成员内部类：
    class Inner07{
        private int inCount = 10;

        public int inSize = 12;

        public void m2(){
            //内部类直接访问外部类
            System.out.println("Outter07的私有属性count=" + count);
            System.out.println("Outter07的公共属性size=" + size);
            System.out.println("Inner07的m2()");
        }
    }

    //外部类如何访问内部类：
    public void m1(){
        Inner07 inner07 = new Inner07();
        System.out.println("Inner07的私有属性inCount=" + inner07.inCount);
        System.out.println("Inner07的公共属性inSize=" + inner07.inSize);
        inner07.m2();
    }



    public static void main(String[] args) {
        Outter07 outter07 = new Outter07();
        outter07.m1();
    }
}

